import { cyHttp as http } from '@/services/http';
import type {
  UserIncrease,
  UserIncreaseResult,
  UserIncreaseTrend,
  UserIncreaseTrendResult,
  UserIncreaseRetained,
  UserIncreaseRetainedResult
} from '@/types/api/crm-cy/statistics';

// 今日统计
export const statCore = (params: UserIncrease) =>
  http<UserIncreaseResult>({
    method: 'get',
    url: '/api/admin/statistics/core',
    params
  });

// 趋势图
export const statTrend = (params: UserIncreaseTrend) =>
  http<UserIncreaseTrendResult>({
    method: 'get',
    url: '/api/admin/statistics/trend',
    params
  });

// 留存, mergeConfig = { noLoading: true }
export const statRetained = (params: UserIncreaseRetained) =>
  http<UserIncreaseRetainedResult>({
    method: 'get',
    url: '/api/admin/statistics/retained',
    params
  });
